package com.liu.service;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;

/**
 * @author liuyang
 * @title: UserService
 * @projectName dubbo
 * @description: TODO
 * @date 2022/11/2123:16
 */
@Service // 放到容器中
public class UserService {

    @Reference // 引用，pom坐标，可以定义相同路径的接口名
    TicketService ticketService;

    public void buyTicket() {
        String ticket = ticketService.getTicket();
        System.out.println("在注册中心拿到票=>" + ticket);
    }
}
